Add host dependency path via -L for cargo_test.
authorLucas Kolstad <lkolstad@uw.edu>
Tue, 29 Aug 2017 10:43:41 +0000 (03:43 -0700)
committerLucas Kolstad <lkolstad@uw.edu>
Tue, 29 Aug 2017 11:18:32 +0000 (04:18 -0700)
commit2b7f37b5a22116d902a03ae1661a25cb2d6ff389
treed49b721cec3a6831affec3575020a1df3a1ca7ee
parent814c38945e380d33483d0e3f7552e38534ad1a94
Add host dependency path via -L for cargo_test.

Proc-macro crates' dependencies in the host dependency directory cannot
be found when running `cargo test` with the `--target {target}` flag
set. This adds the host dependency directory with -L when building tests
and a test case that fails before and passes after this patch.

A new function find_host_deps(..) is added to accomplish this which can
determine the path of the host dependencies directory from within
run_doc_tests(..) where the missing library search path is needed.

Fixes #4224
Fixes #4254
src/cargo/ops/cargo_test.rs
tests/test.rs